<extend name="Base/common"/>
<block name="style">
<link href="__CSS__/lyz.calendar.css" rel="stylesheet" type="text/css" />
<style type="text/css">
	p{
		height: 30px;
		line-height: 30px;
		float: left;
		text-align: left;
		padding-right: 5px;
		
		font-size: 12px;
		color:#f8b62d

	}
	p span{
		width: 25%;
		height: 40px;
		background: #EDEDED;
		border:1px solid #ccc;
		border-right: none;
		line-height: 40px;
		text-align: center;
		float: left;
	}


	.tips{
        position:fixed;
        /*top:-10px;*/
        background: rgba(41,81,196,0.5);
        width:100%;
        color:#fff;
        font-size:16px;
        text-align: left;
        text-indent: 2em;
        line-height:30px;
        z-index: 9;
        display: none;
    }
    .j_button{
    	float: left;
    	width:70px;
    	height:25px;
    	font-size: 14px;
    	line-height: 25px;
    	text-align: center;
    	color: #fff;
    	border:none;
    }
</style>
<script src="http://www.jq22.com/jquery/1.4.4/jquery.min.js"></script>
</block>
<block name="body">

<p class="tips"></p>

<div style="width:100%;position:fixed;top:0;z-index:2;padding-left: 5%;background:#f8f8ff;">
	<p>保证金：{$one.money}</p>
	<p>供码总数：{$count}</p>
	<p>平台费率：{$info[0].rate}</p>
	<!-- <p>平台费率：2.5%</p> -->
	<p class="erwm" style="float:right;margin-right:5%;">授权码>></p>
	<div style="clear:both"></div>

<!-- 	<p style="float:none;"><input class="all" tyle="text" style="border:0;border-bottom:1px solid #ccc;background:none;width:45%;height: 100%;"><button type="button" class="login-btn " style="margin-top:0px;float:right;width:50%;height:25px;margin-top:2.5px;line-height:25px">全部修改</button></p>
	 -->
</div>
<div style="height:30px;"></div>

<div style="width:100%;margin:auto;">


			

	
	<empty name="info">
		<!-- <p style="font-size:12px;line-height:15px;margin-top:5px;height:15px;width:90%">提示：</p>
		<p style="font-size:12px;line-height:15px;margin-top:5px;height:15px;width:90%">1、点击费率可修改，可自由下架/下架口碑码。</p>
		<p style="font-size:12px;line-height:15px;margin-top:5px;height:15px;width:90%">2、您得到的利润为平台费率减去费率。</p> -->

	<else/>
		<foreach name="info" item="vo">
		        <div class="weui-form-preview" style="color:#898989">
		            <div class="weui-form-preview__bd">
		                <div class="weui-form-preview__item">
		                    <label class="weui-form-preview__label">码主：<font style="color:#0085d0">{$vo.name}</font></label>
		                    <span class="weui-form-preview__value">
		                    	<php>
									if(empty($vo['create_time'])){
	                                    echo '';
	                                }else{
	                                    echo date("Y-m-d",$vo['create_time']);
	                                }
									
								</php>
							</span>
		                </div>
		                <div class="weui-form-preview__item">
		                    <label class="weui-form-preview__label">收款范围</label>
		                    <span class="weui-form-preview__value">
		                    	<php>
									if($vo['type']==1){
										echo '1-500';
									}else if($vo['type']==2){
										echo '501-800';
									}else if($vo['type']==3){
										echo '801-2000';
									}else if($vo['type']==4){
										echo '>2000';
									}
								</php>
		                    </span>
		                </div>

		                <div class="weui-form-preview__item">
		                    <label class="weui-form-preview__label">交易量</label>
		                    <span class="weui-form-preview__value">
		                    	<php>
									$_this=D('Dingdan')->where(['seller_id'=>$vo['user_id']])->find();
									if(empty($_this)){
											echo '';
									}else{
										$money=D('Dingdan')->where(['status'=>1,'seller_id'=>$vo['user_id']])->sum('pay_money');

										echo $money;
									}
									
								</php>

		                    </span>
		                </div>
		                <div class="weui-form-preview__item">
		                    <label class="weui-form-preview__label">暂缓金额</label>
		                    <span class="weui-form-preview__value">
		                    	<php>
	                                if($vo['use_status']==1){
	                                    echo '';
	                                }else{
	                                    echo $vo['money'];
	                                }
	                            </php>
		                    </span>
		                </div>
		                <div class="weui-form-preview__item">
		                    <label class="weui-form-preview__label">下架原因</label>
		                    <span class="weui-form-preview__value">{$vo.cause}</span>
		                </div>
		                

		                <div class="weui-form-preview__item">
		                	
		                    
		                    	<input type="hidden" class="id"  value="{$vo.id}">
								<input type="hidden" class="uid"  value="{$vo.uid}">
		                    	<php>
									if($vo['use_status']==0){
										echo '<button class="j_button sj" style="background:#f00;margin-left:46%">已下架</button>';
									}else{
										echo '<button class="j_button xj" style="background:#0085d0;margin-left:46%">上架中</button>';
									}
								</php>
								<p  class="j_button" style="width:100px;background:#f8b62d;float:right;margin-right:0px;padding:0">
									<font style="float:left;width:45%;text-align:right;">费率:</font><input class="rate2" type="text" style="float:right;border:none;background:none;width:50%;line-height:25px;color:#fff;" value="{$vo.rate2}">

								</p>
								<div style="clear:both"></div>
		                    
		                    
		                </div>
		                

		            </div>

		        </div>




		</foreach>
	</empty>






</div>
		

        <style type="text/css">
			.td_block{
				width:100%;
				height:100%;
				position:absolute;
				z-index: 3;
				top:0;
				background: rgba(0,0,0,0.4);
				text-align: center;
				color: red;
				display: none;
				border-radius: 5px 5px;
			}
			.td_block .tg_ewm{
				width:200px;
				height:225px;
				margin:0 auto;
				margin-top: 20%;
				background: #fff;
				border-radius: 5px 5px;
			}
		</style>
		<div class="td_block">
			<div class="tg_ewm">
				<php>
					$uid=$one['uid'];
					$url = "https://openauth.alipay.com/oauth2/appToAppAuth.htm?app_id=2018020602149769&redirect_uri=http://qnm.upslope.cn/pay.php&uid={$uid}";

					$url= urlencode($url);
				</php>
				<img  src="{:U('Admin/Public/qrcode?type=8&url='.$url)}" style="border-radius: 5px 5px;margin-top:0">
				<div>支付宝扫一扫授权</div>
			</div>
		</div>
	

</block>



<block name="script">
	<script type="text/javascript">
//点击隐藏
$(".tg_ewm").click(function(e){
    $(this).show();
    e.stopPropagation();//阻止冒泡
});
$('.td_block,.bottom').click(function(){
    $(".td_block").hide();
 
})





	$('.erwm').click(function(){
		$('.td_block').show()
	})

		
		$('.rate2').change(function(){

			var _this=$(this);
			var rate2=_this.val()
			var id=_this.parent().parent().find('.id').val();
			$.ajax({
				type:'post',
				data:{'rate2':rate2,'id':id},
				url:"{:U('kbsh3')}",
				success:function(m){
					if(m>0){
						$('.tips').html('修改成功')
						$('.tips').show()
                        setTimeout(function(){
                            $('.tips').hide()
                            location.reload();
                        },3000)
						
						
					}else if(m==0){
						$('.tips').html('修改失败')
						$('.tips').show()
                        setTimeout(function(){
                            $('.tips').hide()
                            
                        },3000)
					}else{
						$('.tips').html(m)
						$('.tips').show()
                        setTimeout(function(){
                            $('.tips').hide()
                            
                        },3000)
					}
				}
			})
		})



		$('.sj').click(function(){
            
            var _this=$(this);
			var id=_this.parent().find('.id').val();
			$.ajax({
				type:'post',
				data:{'use_status':1,'id':id},
				url:"{:U('kbsh2')}",
				success:function(m){
					// alert(m)
					if(m>0){
						
						$('.tips').html('修改成功')
						$('.tips').show()
                        setTimeout(function(){
                            $('.tips').hide()
                            location.reload();
                        },3000)
						
						
					}else if(m==0){
						$('.tips').html('修改失败')
						$('.tips').show()
                        setTimeout(function(){
                            $('.tips').hide()
                            
                        },3000)
					}else{
						$('.tips').html(m)
						$('.tips').show()
                        setTimeout(function(){
                            $('.tips').hide()
                            
                        },3000)
					}
				}
			})

        })
        $('.xj').click(function(){
            
            var _this=$(this);
			var id=_this.parent().find('.id').val();
			// var uid=_this.parent().find('.uid').val();
			// alert(id)
			$.ajax({
				type:'post',
				data:{'use_status':0,'id':id},
				url:"{:U('kbsh2')}",
				success:function(m){
					// alert(m)
					if(m>0){

						$('.tips').html('修改成功')
						$('.tips').show()
                        setTimeout(function(){
                            $('.tips').hide()
                            location.reload();
                        },3000)
						
						
					}else if(m==0){
						$('.tips').html('修改失败')
						$('.tips').show()
                        setTimeout(function(){
                            $('.tips').hide()
                            
                        },3000)
					}else{
						$('.tips').html(m)
						$('.tips').show()
                        setTimeout(function(){
                            $('.tips').hide()
                            
                        },3000)
					}
				}
			})
        })



// $('.login-btn').click(function(){
// 	var all=$('.all').val()
// 	$.ajax({

// 		type:'post',
// 		data:{'rate2':all,'id':1},
// 		url:"{:U('kbsh3')}",
// 		success:function(m){
// 			if(m>0){

// 				$('.tips').html('修改成功')
// 				$('.tips').show()
//                 setTimeout(function(){
//                     $('.tips').hide()
//                     location.reload();
//                 },3000)
				
				
// 			}else if(m==0){
// 				$('.tips').html('修改失败')
// 				$('.tips').show()
//                 setTimeout(function(){
//                     $('.tips').hide()
                    
//                 },3000)
// 			}else{
// 				$('.tips').html(m)
// 				$('.tips').show()
//                 setTimeout(function(){
//                     $('.tips').hide()
                    
//                 },3000)
// 			}
// 		}
// 	})
// })







	</script>


	
</block>